import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;


public class ClientCXF {

	public static void main(String[] args) {
		
		System.out.println("starting Client...");
		
		//定义JaxWs代理工厂
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
		
		//设置JaxWs代理工厂的属性，包括服务类和地址
		factory.setServiceClass(HelloWorld.class);
		factory.setAddress("http://localhost:9999/HelloWorld");
		
		//获取服务类的对象并处理
		HelloWorld hw = (HelloWorld)factory.create();
		System.out.println(hw.sayHello("涂有2"));
		System.exit(0);
	}
}
